<%@ page contentType="text/html;charset=utf-8"%>
<%@ page language="java" import="weibo4j.*"%>
<%@ page language="java" import="weibo4j.http.*"%>
<%@ page language="java" import="com.qiu.wbpostman.common.AppConstants"%>
<jsp:useBean id="weboauth" scope="session"
	class="weibo4j.examples.WebOAuth" />
<%
	if ("1".equals(request.getParameter("opt"))) {
		RequestToken resToken = weboauth
				.request(AppConstants.DOMAIN_URL+"/callback.jsp");
		if (resToken != null) {
			out.println(resToken.getToken());
			out.println(resToken.getTokenSecret());
			session.setAttribute("resToken", resToken);
			response.sendRedirect(resToken.getAuthorizationURL());
		} else {
			out.println("request error");
		}
	} else {
%>
<head>
     <title>微博邮差</title>
     <LINK rel=stylesheet type=text/css href="css/cube_web.css">
</head>
<body sizcache="19" sizset="0" >
    <div id="doc1" sizcache="15" sizset="0">
        <div id="hd" sizcache="15" sizset="0">
            <div id="userPanel">
                <a href="#">收藏本站</a> <span class="sl">|</span>
                <a href="#">转发给好友</a> <span class="sl">|</span> <a href="#">关注作者</a>
                <span class="sl">|</span> <a href="#">
                    帮助</a>
            </div>
            <div id="logo">
                <a href="#">
                    <img class="ie6PngFix" title="微博邮差" alt="微博邮差" src="/imgs/cube_logo.png" /></a>
                <span>微博邮差</span>
            </div>
            
            <div id="nav" sizcache="15" sizset="0">
                <ul sizcache="15" sizset="0">
                    <li><a href="#">我的首页</a> </li>
                    <li><a href="#">邮差设置</a> </li>
                    <li><a href="#">帮助中心</a> </li>
                    <li><a href="#">实验室</a> </li>
                </ul>
                <span class="left-side"></span><span class="right-side"></span>
            </div>
        </div>
        <div id="bd" sizcache="15" sizset="4">
            <div class="clearfix wbcl">
                <div id="userLocation">
                </div>
                <div id="userWelcome">
                    <div class="hd">
                        <h2 class="title">
                            欢迎使用微博邮差</h2>
                    </div>
                    <div class="bd clearfix">
                        <div class="description">
                            <p>
                                使用邮箱关注最新微博</p>
                            <p>
                                订阅最新评论、回复</p>
                            <p>
                                及时关注自己的状态</p>
                            <p>
                                邮箱编织微博...</p>
                        </div>
                    </div>
                    <div class="ft clearfix">
                       <a class="more-friend-news" href="#" >
                       <img src="imgs/weibo_btn_48.png" />
                       </a>
                       <a class="more-about" style="margin-left:90px; margin-top:15px" href="index.jsp?opt=1">
                       <span>由新浪网站登录授权</span>
                       </a>
                    </div>
                </div>
                <div id="userMobileAgent">
                 <div class="ft"/>
                </div>
            </div>
        </div>
    </div>
</body>
<%
	}
%>